﻿#region Copyright and License
/*==============================================================================
 *  Copyright (c) cndotnet.org Corporation.  All rights reserved.
 * ===============================================================================
 * This code and information is provided "as is" without warranty of any kind,
 * either expressed or implied, including but not limited to the implied warranties
 * of merchantability and fitness for a particular purpose.
 * ===============================================================================
 * Licensed under the GNU General Public License (GPL) v2
 * http://www.cndotnet.org/ucenter
 * ==============================================================================*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UCenter.Models;
using UCenter.BusinessContract;
using UCenter.Core.Validations;

namespace UCenter.Services.Extensions
{
    /// <summary>
    /// The extension methods class of friend group
    /// </summary>
    public static class FriendGroupContractExtension
    {
        /// <summary>
        /// Converts to entity.
        /// </summary>
        /// <param name="contract">The contract.</param>
        /// <returns></returns>
        public static FriendGroup ConvertToEntity(this FriendGroupContract contract)
        {
            ValidationUtility.IsNullValidate<FriendGroupContract>(contract);

            FriendGroup group = new FriendGroup { 
                ID = contract.ID,
                GroupName = contract.GroupName,
                UserId = contract.UserID
            };

            return group;
        }
    }
}
